package skewreduce.framework.physical;

import org.apache.hadoop.fs.Path;

import skewreduce.framework.logical.LogicalOp;


public abstract class PProcessOp extends MonitoredPhysicalOp {	
    @Override
    protected Path getOutputByContext(PhysicalOp op) {
        LogicalOp.Type optype = op.getType();
        String fn = null;
        // always running a single mapper
        switch ( optype ) {
            case MERGE: fn = "merge-m-00000"; break;
            case FINALIZE: fn = "part-m-00000"; break;
            default:
                throw new IllegalArgumentException();
        }

        Path p = new Path(getOutputPath(),fn);
        return p;
    }
}
